Skip to content

DataFrame.truncate drops MultiIndex names #34589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 20, 2020

Conversation

arw2019
Copy link
Member

@arw2019 arw2019 commented Jun 5, 2020

@MarcoGorelli
Copy link
Member

Thanks @arw2019

Could you add a test to show how this fixes the linked issue?

@arw2019
Copy link
Member Author

arw2019 commented Jun 6, 2020

Could you add a test to show how this fixes the linked issue?

@MarcoGorelli Added the test just now. It's currently inside pandas/tests/indexing/multiindex/test_slice.py but I'll move it if there's a better location for it!

As an aside, I looked in both pandas/pandas/tests/indexes and pandas/pandas/tests/indexing and I couldn't find any other tests for DataFrame.truncate. Either here or in a separate pull request I'd be happy to add additional tests if people think it's a good idea!

@jreback jreback added Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex Bug labels Jun 8, 2020
@arw2019 arw2019 requested a review from jreback June 20, 2020 04:07
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, some comments, merge master and ping on green.


def test_truncate_multiindex_names(self):
# GH 34564

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this tests is duplicative can remove

@jreback jreback added this to the 1.1 milestone Jun 20, 2020
@jreback jreback merged commit 528148f into pandas-dev:master Jun 20, 2020
@jreback
Copy link
Contributor

jreback commented Jun 20, 2020

thanks @arw2019

@arw2019 arw2019 deleted the df-truncate-drops-multiindex-names branch June 21, 2020 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pd.Series/DataFrame.truncate() drops multiindex names
4 participants